#include <bits/stdc++.h>
using namespace std;

bool h[105];
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int total = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] > m)
      continue;
    if (h[a[i]] == false) {
      total++;
      h[a[i]] = true;
    }
    if (total == m) {
      cout << n - (i - 1);
      return 0;
    }
  }
  cout << 0;
  return 0;
}
